# -*- coding: utf-8 -*-
"""
 @Time    : 2021/2/6 下午4:33
 @Author  : tgy
 
"""


class Wrapper:
    ...

    def __init__(self, func):
        self.func = func

    def __call__(self, *args, **kwargs):
        return self.func(*args, **kwargs)


def func_wrapper(cls):
    ...

    class Wrapper:
        ...

        def __init__(self, *args, **kwargs):
            self.instance = cls(*args, **kwargs)

        def __getattr__(self, item):
            return getattr(self.instance, item)

    return Wrapper


@Wrapper
def run(a, b, c):
    ...
    return a + b + c


class Person:
    ...

    def __init__(self, name, age):
        self.name = name
        self.age = age

    @Wrapper
    def eat(self, foot):
        print('eat {}'.format(foot))


if __name__ == '__main__':
    ...
    print(run(1, 2, 3))
    person = Person('tony', 21)
    print(person.age)
    person.eat('cookie')
